textview: remove GtkTextAttributes (un)realize code
authorBenjamin Otte <otte@redhat.com>
Sat, 31 Jul 2010 09:27:34 +0000 (11:27 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:30 +0000 (21:02 +0200)
It was unused (apart from a few assertion that indeed it was unused).

docs/reference/gtk/tmpl/gtktexttag.sgml
gtk/gtktexttag.c
gtk/gtktexttag.h
gtk/gtktexttagprivate.h

index c807da83e3a8c904f5b35a2d99f7a859f62f84e1..85203a04d9a6ddbaeb757ce6f2968319a02b3e60 100644 (file)
@@ -398,7 +398,6 @@ modified directly.
 @invisible: 
 @bg_full_height: 
 @editable: 
-@realized: 
 
 <!-- ##### FUNCTION gtk_text_tag_new ##### -->
 <para>
index 9131e4179c8fbc9996c42d3c49de03a47676060b..25928ce0d997fd53d7938f84cb47275a8c4b9d10 100644 (file)
@@ -699,8 +699,6 @@ gtk_text_tag_finalize (GObject *object)
 
   text_tag = GTK_TEXT_TAG (object);
 
-  g_assert (!text_tag->values->realized);
-
   if (text_tag->table)
     gtk_text_tag_table_remove (text_tag->table, text_tag);
 
@@ -957,8 +955,6 @@ gtk_text_tag_set_property (GObject      *object,
 
   text_tag = GTK_TEXT_TAG (object);
 
-  g_return_if_fail (!text_tag->values->realized);
-
   switch (prop_id)
     {
     case PROP_NAME:
@@ -1914,8 +1910,6 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src,
 {
   guint orig_refcount;
 
-  g_return_if_fail (!dest->realized);
-
   if (src == dest)
     return;
 
@@ -1941,7 +1935,6 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src,
     dest->pg_bg_color = gdk_color_copy (src->pg_bg_color);
 
   dest->refcount = orig_refcount;
-  dest->realized = FALSE;
 }
 
 /**
@@ -1979,8 +1972,6 @@ gtk_text_attributes_unref (GtkTextAttributes *values)
 
   if (values->refcount == 0)
     {
-      g_assert (!values->realized);
-
       if (values->tabs)
         pango_tab_array_free (values->tabs);
 
@@ -1994,61 +1985,6 @@ gtk_text_attributes_unref (GtkTextAttributes *values)
     }
 }
 
-void
-_gtk_text_attributes_realize (GtkTextAttributes *values,
-                              GdkColormap *cmap,
-                              GdkVisual *visual)
-{
-  g_return_if_fail (values != NULL);
-  g_return_if_fail (values->refcount > 0);
-  g_return_if_fail (!values->realized);
-
-  /* It is wrong to use this colormap, FIXME */
-  gdk_colormap_alloc_color (cmap,
-                            &values->appearance.fg_color,
-                            FALSE, TRUE);
-
-  gdk_colormap_alloc_color (cmap,
-                            &values->appearance.bg_color,
-                            FALSE, TRUE);
-
-  if (values->pg_bg_color)
-    gdk_colormap_alloc_color (cmap,
-                             values->pg_bg_color,
-                             FALSE, TRUE);
-
-  values->realized = TRUE;
-}
-
-void
-_gtk_text_attributes_unrealize (GtkTextAttributes *values,
-                                GdkColormap *cmap,
-                                GdkVisual *visual)
-{
-  g_return_if_fail (values != NULL);
-  g_return_if_fail (values->refcount > 0);
-  g_return_if_fail (values->realized);
-
-  gdk_colormap_free_colors (cmap,
-                            &values->appearance.fg_color, 1);
-
-
-  gdk_colormap_free_colors (cmap,
-                            &values->appearance.bg_color, 1);
-
-  values->appearance.fg_color.pixel = 0;
-  values->appearance.bg_color.pixel = 0;
-
-  if (values->pg_bg_color)
-    {
-      gdk_colormap_free_colors (cmap, values->pg_bg_color, 1);
-      
-      values->pg_bg_color->pixel = 0;
-    }
-
-  values->realized = FALSE;
-}
-
 void
 _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
                                      GtkTextTag**       tags,
@@ -2059,8 +1995,6 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
   guint left_margin_accumulative = 0;
   guint right_margin_accumulative = 0;
 
-  g_return_if_fail (!dest->realized);
-
   while (n < n_tags)
     {
       GtkTextTag *tag = tags[n];
index fd74270138a953d42396d36f94b3d3c4a852fd1e..d74a43bf3aa5ea29706ce9c93240a30b984beb56 100644 (file)
@@ -259,9 +259,6 @@ struct _GtkTextAttributes
   /* can edit this text */
   guint editable : 1;
 
-  /* colors are allocated etc. */
-  guint realized : 1;
-
   /*< private >*/
   guint pad1 : 1;
   guint pad2 : 1;
index b3363d9250c870b44efd8f668bcc74ffd58d72b2..afc3a9b345055b2965a49864909d00a906f985b7 100644 (file)
@@ -41,16 +41,6 @@ void _gtk_text_attributes_fill_from_tags   (GtkTextAttributes   *values,
 void _gtk_text_tag_array_sort              (GtkTextTag         **tag_array_p,
                                             guint                len);
 
-/* ensure colors are allocated, etc. for drawing */
-void                _gtk_text_attributes_realize   (GtkTextAttributes *values,
-                                                    GdkColormap       *cmap,
-                                                    GdkVisual         *visual);
-
-/* free the stuff again */
-void                _gtk_text_attributes_unrealize (GtkTextAttributes *values,
-                                                    GdkColormap       *cmap,
-                                                    GdkVisual         *visual);
-
 gboolean _gtk_text_tag_affects_size               (GtkTextTag *tag);
 gboolean _gtk_text_tag_affects_nonsize_appearance (GtkTextTag *tag);